package io;

import com.sun.deploy.util.SyncAccess;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 练习：简易的记事本
 *
 */
public class Test2 {
    public static void main(String[] args) throws IOException {
        //神的记事本
        Scanner scan=new Scanner(System.in);
        FileOutputStream fos=new FileOutputStream("node.txt");
        while (true){
            System.out.println("请输入内容：");
            String len=scan.nextLine();
            if ("exit".equals(len)){
                break;
            }
            byte[] data=len.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
        }
        System.out.println("退出记事本");
        fos.close();
    }
}
